1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module adw.ClampScrollable;
26 
27 private import adw.c.functions;
28 public  import adw.c.types;
29 private import glib.ConstructionException;
30 private import gobject.ObjectG;
31 private import gtk.AccessibleIF;
32 private import gtk.AccessibleT;
33 private import gtk.BuildableIF;
34 private import gtk.BuildableT;
35 private import gtk.ConstraintTargetIF;
36 private import gtk.ConstraintTargetT;
37 private import gtk.OrientableIF;
38 private import gtk.OrientableT;
39 private import gtk.ScrollableIF;
40 private import gtk.ScrollableT;
41 private import gtk.Widget;
42 
43 
44 /**
45  * A scrollable [class@Clamp].
46  * 
47  * `AdwClampScrollable` is a variant of [class@Clamp] that implements the
48  * [iface@Gtk.Scrollable] interface.
49  * 
50  * The primary use case for `AdwClampScrollable` is clamping
51  * [class@Gtk.ListView].
52  *
53  * Since: 1.0
54  */
55 public class ClampScrollable : Widget, OrientableIF, ScrollableIF
56 {
57 	/** the main Gtk struct */
58 	protected AdwClampScrollable* adwClampScrollable;
59 
60 	/** Get the main Gtk struct */
61 	public AdwClampScrollable* getClampScrollableStruct(bool transferOwnership = false)
62 	{
63 		if (transferOwnership)
64 			ownedRef = false;
65 		return adwClampScrollable;
66 	}
67 
68 	/** the main Gtk struct as a void* */
69 	protected override void* getStruct()
70 	{
71 		return cast(void*)adwClampScrollable;
72 	}
73 
74 	/**
75 	 * Sets our main struct and passes it to the parent class.
76 	 */
77 	public this (AdwClampScrollable* adwClampScrollable, bool ownedRef = false)
78 	{
79 		this.adwClampScrollable = adwClampScrollable;
80 		super(cast(GtkWidget*)adwClampScrollable, ownedRef);
81 	}
82 
83 	// add the Orientable capabilities
84 	mixin OrientableT!(AdwClampScrollable);
85 
86 	// add the Scrollable capabilities
87 	mixin ScrollableT!(AdwClampScrollable);
88 
89 
90 	/** */
91 	public static GType getType()
92 	{
93 		return adw_clamp_scrollable_get_type();
94 	}
95 
96 	/**
97 	 * Creates a new `AdwClampScrollable`.
98 	 *
99 	 * Returns: the newly created `AdwClampScrollable`
100 	 *
101 	 * Since: 1.0
102 	 *
103 	 * Throws: ConstructionException GTK+ fails to create the object.
104 	 */
105 	public this()
106 	{
107 		auto __p = adw_clamp_scrollable_new();
108 
109 		if(__p is null)
110 		{
111 			throw new ConstructionException("null returned by new");
112 		}
113 
114 		this(cast(AdwClampScrollable*) __p);
115 	}
116 
117 	/**
118 	 * Gets the child widget of @self.
119 	 *
120 	 * Returns: the child widget of @self
121 	 *
122 	 * Since: 1.0
123 	 */
124 	public Widget getChild()
125 	{
126 		auto __p = adw_clamp_scrollable_get_child(adwClampScrollable);
127 
128 		if(__p is null)
129 		{
130 			return null;
131 		}
132 
133 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
134 	}
135 
136 	/**
137 	 * Gets the maximum size allocated to the child.
138 	 *
139 	 * Returns: the maximum size to allocate to the child
140 	 *
141 	 * Since: 1.0
142 	 */
143 	public int getMaximumSize()
144 	{
145 		return adw_clamp_scrollable_get_maximum_size(adwClampScrollable);
146 	}
147 
148 	/**
149 	 * Gets the size above which the child is clamped.
150 	 *
151 	 * Returns: the size above which the child is clamped
152 	 *
153 	 * Since: 1.0
154 	 */
155 	public int getTighteningThreshold()
156 	{
157 		return adw_clamp_scrollable_get_tightening_threshold(adwClampScrollable);
158 	}
159 
160 	/**
161 	 * Sets the child widget of @self.
162 	 *
163 	 * Params:
164 	 *     child = the child widget
165 	 *
166 	 * Since: 1.0
167 	 */
168 	public void setChild(Widget child)
169 	{
170 		adw_clamp_scrollable_set_child(adwClampScrollable, (child is null) ? null : child.getWidgetStruct());
171 	}
172 
173 	/**
174 	 * Sets the maximum size allocated to the child.
175 	 *
176 	 * Params:
177 	 *     maximumSize = the maximum size
178 	 *
179 	 * Since: 1.0
180 	 */
181 	public void setMaximumSize(int maximumSize)
182 	{
183 		adw_clamp_scrollable_set_maximum_size(adwClampScrollable, maximumSize);
184 	}
185 
186 	/**
187 	 * Sets the size above which the child is clamped.
188 	 *
189 	 * Params:
190 	 *     tighteningThreshold = the tightening threshold
191 	 *
192 	 * Since: 1.0
193 	 */
194 	public void setTighteningThreshold(int tighteningThreshold)
195 	{
196 		adw_clamp_scrollable_set_tightening_threshold(adwClampScrollable, tighteningThreshold);
197 	}
198 }